Skip to content

Conversation

lightboys22
Copy link

@lightboys22 lightboys22 commented Oct 6, 2025

… the Swift example on creating a Lambda function

Do not merge this change.

I just want to report bug on the Swift example on creating a Lambda function.

If we don't have the "authMode: AWSAuthorizationType.amazonCognitoUserPools" change, I will get the following run time error when my Swift app make the GraphQL request:

"Not Authorized to access sayHello on type Query"

Regarding the following change, ...

struct SayHelloResponse: Codable {
    public let sayHello: String
}

struct PushNotifyRequest {
  private static let document = 
    """
    query EchoQuery($name: String!) {
      sayHello(name: $name)
    }
    """

Since the "sayHello" only returns a String, a String struct doesn't have properties, such as "name" or "executionDuration". So I remove those two properties.

I only know how to fix the Swift example. I haven't fix the example for other platforms.

Below is the document I would like to fix.
https://github.com/aws-amplify/docs/blob/main/src/pages/%5Bplatform%5D/build-a-backend/functions/set-up-function/index.mdx

Description of changes:

Related GitHub issue #, if available:

Instructions

If this PR should not be merged upon approval for any reason, please submit as a DRAFT

Which product(s) are affected by this PR (if applicable)?

  • amplify-cli
  • amplify-ui
  • amplify-studio
  • amplify-hosting
  • amplify-libraries

Which platform(s) are affected by this PR (if applicable)?

  • JS
  • Swift
  • Android
  • Flutter
  • React Native

Please add the product(s)/platform(s) affected to the PR title

Checks

  • Does this PR conform to the styleguide?

  • Does this PR include filetypes other than markdown or images? Please add or update unit tests accordingly.

  • Are any files being deleted with this PR? If so, have the needed redirects been created?

  • Are all links in MDX files using the MDX link syntax rather than HTML link syntax?

    ref: MDX: [link](https://docs.amplify.aws/)
    HTML: <a href="https://docs.amplify.aws/">link</a>

When this PR is ready to merge, please check the box below

  • Ready to merge

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

… the Swift example on creating a Lambda function

Do not merge this change.

I just want to report bug on the Swift example on creating a Lambda function.

If we don't have the "authMode: AWSAuthorizationType.amazonCognitoUserPools" change, I will get the following run time error when my Swift app make the GraphQL request:

```
"Not Authorized to access sayHello on type Query"
```


Regarding the following change, ...
```
struct SayHelloResponse: Codable {
    public let sayHello: String
}

struct PushNotifyRequest {
  private static let document = 
    """
    query EchoQuery($name: String!) {
      sayHello(name: $name)
    }
    """
```
Since the "sayHello" only returns a String, a String struct doesn't have properties, such as "name" or "executionDuration". So I remove those two properties.

I only know how to fix the Swift example. I haven't fix the example for other platforms. 

Below is the document I would like to fix.
https://github.com/aws-amplify/docs/blob/main/src/pages/%5Bplatform%5D/build-a-backend/functions/set-up-function/index.mdx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant